package com.liu.sx.handler;

import com.liu.sx.common.entity.Result;
import com.liu.sx.common.status.CodeEnum;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(RuntimeException.class)
    public Result doRunException(Exception e){
       return  new Result(false, CodeEnum.LOGIN_ERROR.getCode(),e.getMessage());
    }


}
